//
//  LJFListCollectionViewCell.m
//  GiftThat
//
//  Created by 刘景峰 on 16/1/13.
//  Copyright © 2016年 ChuXiang. All rights reserved.
//

#import "LJFListCollectionViewCell.h"

@implementation LJFListCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.label = [[UILabel alloc]initWithFrame:CGRectZero];
        self.label.textAlignment = UITextAlignmentCenter;
        self.label.layer.cornerRadius = 10;
        self.label.layer.borderColor = [[UIColor grayColor]CGColor];
        self.label.font = [UIFont systemFontOfSize:15];
        self.label.layer.borderWidth = 0.5f;
        [self addSubview:self.label];
    }
    
    return self;
}

-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    [super applyLayoutAttributes:layoutAttributes];
    self.label.frame = CGRectMake(10, 5, self.width- 20, self.height - 10);
}

-(void)setListModel:(LJFListModel *)listModel{
    
    if (_listModel != listModel) {
        _listModel = listModel;
    }
    self.label.text = listModel.name;

}

@end
